package com.kzw.oa.system.model;

import java.io.Serializable;
import java.util.HashSet;
import java.util.Set;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;

@Entity
@Table(name = "app_function")
public class AppFunction implements Serializable {
	private static final long serialVersionUID = -4380270087450156189L;

	@Id
	@GeneratedValue(strategy = GenerationType.IDENTITY)
	protected Long functionId;

	@Column(unique = true, length = 100)
	protected String funKey;

	@Column
	protected String funName;

	@OneToMany(mappedBy = "appFunction")
	protected Set<FunUrl> funUrls = new HashSet<FunUrl>();

	public AppFunction() {
	}

	public AppFunction(String funKey, String funName) {
		this.funKey = funKey;
		this.funName = funName;
	}

	public AppFunction(Long in_functionId) {
		this.setFunctionId(in_functionId);
	}

	public Set<FunUrl> getFunUrls() {
		return funUrls;
	}

	public void setFunUrls(Set<FunUrl> in_funUrls) {
		this.funUrls = in_funUrls;
	}

	public Long getFunctionId() {
		return this.functionId;
	}

	public void setFunctionId(Long aValue) {
		this.functionId = aValue;
	}

	/**
	 * 权限Key
	 */
	public String getFunKey() {
		return this.funKey;
	}

	public void setFunKey(String aValue) {
		this.funKey = aValue;
	}

	/**
	 * 权限名称 *
	 */
	public String getFunName() {
		return this.funName;
	}

	public void setFunName(String aValue) {
		this.funName = aValue;
	}

}
